package com.yznote.cloudesk.common.utils;

import com.yznote.cloudesk.common.pojo.DeskFile;
import com.yznote.cloudesk.common.pojo.File;

/**
 * @author : xiaozhoutongxue
 * @date : 2022/11/4 11:20
 */
public class DeskFile2FileUtils {
    public static File deskFile2File(DeskFile deskFile) {
        File file = new File();
        file.setFileFaId(deskFile.getFileFaId());
        file.setFileId(deskFile.getFileId());
        file.setFileName(deskFile.getFileName());
        file.setFileLevel(deskFile.getFileLevel());
        file.setFilePath(deskFile.getFilePath());
        file.setFileType(deskFile.getFileType());
        file.setUserId(deskFile.getUserId());
        file.setMemory(deskFile.getMemory());
        return file;
    }

    public static DeskFile File2deskFile(File file,Integer x,Integer y) {
        DeskFile deskFile = new DeskFile();
        deskFile.setFileFaId(file.getFileFaId());
        deskFile.setFileId(file.getFileId());
        deskFile.setFileName(file.getFileName());
        deskFile.setFileLevel(file.getFileLevel());
        deskFile.setFilePath(file.getFilePath());
        deskFile.setFileType(file.getFileType());
        deskFile.setUserId(file.getUserId());
        deskFile.setMemory(file.getMemory());
        deskFile.setX(x);
        deskFile.setY(y);
        return deskFile;
    }
}
